<?php

namespace app\admin\validate;

use think\Validate;

class Equipment extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'name' => 'require',
        'marking' => 'require',
        'serial' => 'require',
        'software_version' => 'require',
        'next_json' => 'require',
        'department_id' => 'require',
    ];

    /**
     * 字段描述
     */
    protected $field = [
    ];
    /**
     * 提示消息
     */
    protected $message = [
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => ['name', 'marking', 'serial','software_version','next_json','department_id'],
        'edit' => ['name', 'marking', 'serial','software_version','next_json','department_id'],
    ];

    public function __construct(array $rules = [], $message = [], $field = [])
    {
        $this->field = [
            'name' => __('Name'),
            'marking' => __('Marking'),
            'serial' => __('Serial'),
            'software_version' => __('Software_version'),
            'next_json' => __('Next_json'),
            'department_id' => __('Department_id'),
        ];
        parent::__construct($rules, $message, $field);
    }

}
